/*
 * Created on 24 oct. 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package fr.jade.console.cmd;

import org.objectweb.fractal.api.Component;

import fr.jade.console.core.AbstractCommand;
import fr.jade.console.core.Command;
import fr.jade.console.core.Environment;
import fr.jade.reflex.util.Reflex;


/**
 * @author ssicard
 */
public class PrintLevel extends AbstractCommand implements Command{

  public String getDescription(){
    return "prints the level (meta/exec) of the current component";
  }
  
  public String getHelp(){
    return "switchlevel";
  }
  
  public String getName() {
    return "printlevel";
  }
  
	public Object execute(String[] args, Environment env) throws Throwable /*throws Exception*/ {
		
		Component cmp = (Component)env.getEnvVar("curent");
		System.out.println(Reflex.getLevel(cmp));
		return null;
	}
}
